import { SearchModel } from "../../models";
import { MemberItem, MemberReq } from "./models";
import req from "/@/api/req";

export enum Api {
  addCustomerGroups = "api/aiot/customerGroups/addCustomerGroups",
  deleteCustomerGroupsByIds = "api/aiot/customerGroups/deleteCustomerGroupsByIds",
  getCustomerGroups = "api/aiot/customerGroups/getCustomerGroups",
  updateCustomerGroups = "api/aiot/customerGroups/updateCustomerGroups",

  addCustomers = "api/aiot/customers/addCustomers",
  deleteCustomersByIds = "api/aiot/customers/deleteCustomersByIds",
  getCustomerPage = "api/aiot/customers/page",
  updateCustomers = "api/aiot/customers/updateCustomers",
  // 新增成员
  addCustomerUserInfo = "api/aiot/customerUserInfo/addCustomerUserInfo",
  deleteCustomerUserInfoByIds = "api/aiot/customerUserInfo/deleteCustomerUserInfoByIds",
  getMemberList = "api/aiot/customerUserInfo/page",
}

// 新增成员
export function addCustomerUserInfo(data: MemberReq) {
  return req.post<MemberItem>({
    data,
    url: Api.addCustomerUserInfo,
  });
}

export function deleteCustomerUserInfoByIds(data: string[]) {
  return req.post<Boolean>({
    data,
    url: Api.deleteCustomerUserInfoByIds,
  });
}

export function getMemberList(data: SearchModel) {
  return req.post<MemberItem[]>({
    data,
    url: Api.getMemberList,
  });
}
